package com.codeest.geeknews.base.contract.main;

import com.codeest.geeknews.base.BasePresenter;
import com.codeest.geeknews.base.BaseView;
import com.codeest.geeknews.model.bean.DoubanChannelBean;
import com.codeest.geeknews.model.bean.DoubanLoginBean;
import com.codeest.geeknews.model.bean.DoubanLyricBean;
import com.codeest.geeknews.model.bean.DoubanPlaylistBean;

/**
 * Created by codeest on 2016/8/23.
 */
public interface DoubanContract {
    interface LoginView extends BaseView {
        void loginSucceed(DoubanLoginBean login);
    }

    interface ViewExt extends BaseView {
        void channelsLoaded(DoubanChannelBean channels);

        void playlistLoaded(DoubanPlaylistBean playlist);

        void lyricLoaded(DoubanLyricBean playlist);
    }


    interface Presenter extends BasePresenter<BaseView> {
        /**
         * 返回结果：<br>
         * {<br>
         * "access_token": "21a0867e86f16fb464e1937b94d44f1w",<br>
         * "douban_user_id": 145636941,<br>
         * "douban_user_name": "xxxx",<br>
         * "expires_in": 7775999,<br>
         * "refresh_token": "77bc1538a652d3b867343fa9f2f87b18"<br>
         * }<br>
         * <p>
         * 在获得access_token和expire后，保存起来，expire 应该是默认的90天的过期时间, 在使用获取歌曲列表、红心等API时，
         * 需要在相应的请求header里面添加Authorization字段，对应的值是Bearer+ access_token， 注意Bearer后面是有空格的，
         * 例如 Bearer 21a0867e86f16fb464e1937b94d44f1w
         *
         * @param name-
         * @param pwd-
         */
        void login(String name, String pwd);

        void getChannels();

        //void getDefaultPlaylist();

        void getPlaylist(String channelId);

        void getLyric(int sid, String ssid);

    }
}
